home *** CD-ROM | disk | FTP | other *** search
- Path: news1.is.net!news
- From: Mark VanTassel <mvantassel@teambca.com>
- Newsgroups: comp.lang.c++
- Subject: Re: linking C & C++
- Date: Tue, 26 Mar 1996 18:00:49 -0500
- Organization: Barfield, Cauthen and Associates
- Message-ID: <31587721.4AAA@teambca.com>
- References: <4ibsla$pll@news.onramp.net>
- NNTP-Posting-Host: dynamic23.is.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win95; I)
-
- Dean wrote:
- >
- > I'm doing some work on a system that now requires me to do a longjmp from a C
- > program back into a C++ program. The whole thing is linked into one big
- > executable. I am having some trouble getting the thing linked, and I have
- > tried a number of different combinations. What I have is a signal(), and
- > alarm(), and a longjmp() in the C file, and a setjmp() in the C++ file. I have
- > tried defining the jmpbuffer in both files with it as an exter in the other,
- > but the linker always gives me a not-found condition for the jmpbuffer. I know
- > that there is probably some little something that I'm not doing correctly, but
- > could use some ideas. There are function calls in the C++ file to functions in
- > the C file, which then return, and everything there works just fine. Any
- > suggestions? Thanks.
-
- I'm not sure this is a good idea - if you can get it to work at all,
- you'll probably find that destructors don't get called for local vars as
- it backs out of the C++ functions on its way back to the setjmp()...
- this can lead to memory leaks, files left open, or all sorts of other
- mayhem.
-
- (if you're just going to print a message and die, that may not be a
- terrible problem)
-